<?php

namespace app\cps\validate;

use think\Validate;
use app\common\Error;

class Back extends Validate
{
    protected $rule = [
        'id' => 'require',
        'name' => 'require',
        'id_string' => 'require',
        'type' => 'require',
        'back_rate_type' => 'require',
        'link_id' => 'require',
        'echo_rate' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        'name.require' => Error::BACK_NAME_NOT_EXIXTS,
        'id_string.require' => Error::PLEASE_CHOICE_ECHO_DATA,
        'type.require' => Error::PLEASE_SELECT_BACK_TYPE,
        'back_rate_type.require' => Error::BACK_RATE_TYPE_NOT_EXIXTS,
        'link_id.require' => Error::LINK_ID_NOT_EXIXTS,
        'echo_rate.require' => Error::ECHO_RATE_NOT_EXIXTS,
    ];

    protected $scene = [
        'detail' => ['id'],
        'add' => ['name', 'type', 'back_rate_type'],
        'edit' => ['id', 'name', 'type', 'back_rate_type'],
        'batch_echo' => ['id_string'],
        'edit_echo_rate' => ['link_id'],
    ];
}